import numpy as np
def cal_grad(grad_sign_64,grad_sign_48,grad_sign_4):
    grad_0_4_64=grad_sign_64[:40000]
    grad_0_4_48 = grad_sign_48[:40000]
    grad_0_4_4 = grad_sign_4[:]
    mask=(grad_0_4_4==grad_0_4_64)
    same_grad_count=sum(mask*grad_0_4_48)
    print("40000的完全相似度:",same_grad_count/40000)
    grad_mean=np.sum(grad_0_4_4,grad_0_4_48,grad_0_4_64)
    grad_mean=np.sign(grad_mean)
    print("交叉相似度")
    print(np.sum(grad_mean==grad_0_4_64))
    print(np.sum(grad_mean == grad_0_4_48))
    print(np.sum(grad_mean == grad_0_4_4))



